package com.itheima.stream流.实例;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Map;
import java.util.stream.Collectors;

public class Demo6 {
    public static void main(String[] args) {
        ArrayList<String> list=new ArrayList<>();
        Collections.addAll(list,"zhangsan,24","lisi,23","wangwu,25");
        Map<String, String> collect = list.stream().filter(s -> Integer.parseInt(s.split(",")[1]) >= 24).collect(Collectors.toMap(s -> s.split(",")[0], s -> s.split(",")[1]));
//       collect.entrySet().stream().filter((s1,s2)->Integer.parseInt(s2)>24).collect(Collectors.toMap());
        System.out.println(collect);
    }
}
